<?php
 include "counter2.php";

pagestart(); ?>
<html>
<?php pagehead(_("Administrative Interface")) ?>
<body bgcolor="white">
<?php pagetop(_("Linux Counter Administrative Interface")) ?>
<strong><?php print _("You are logged in as user") ?> <?php echo getenv('REMOTE_USER') ?></strong> 
<p>
<?php print _("The powers you have at the moment are:") ?>
<ul>
<li><?php print _("Modify info on places of the counter.") ?></li>
<li><?php print _("List users under a place") ?></li>
<li><?php print _("Find random users") ?></li>
<li><?php print _("Edit those users' records") ?></li>
</ul>
<?php print _("If you change an user's contact email (the first one), he will get email sent to him (both old and new address). Take care!") ?>
<p>
<h2><?php print _("List functions") ?></h2>
<ul>
<li><a href="/cgi-bin/adm/place.cgi"><?php print _("The Place Tree") ?></a></li>
<li><a href="<?php print $counter_site ?>/reports/maintainers.php"><?php print _("The List of maintainers by place") ?></a></li>
<li><a href="maintainers.php"><?php print _("The List of maintainers by name or login time") ?></a></li>
<li><a href="recentusers.php"><?php print _("Watch registrations as they come in") ?></a></li>
<li><a href="<?php print $counter_site ?>/reports/malusstatus.php"><?php print _("Attempts to crawl the counter") ?></a></li>
<li><a href="lost-people.php"><?php print _("Registrations with lost email addresses. The list can be geographically limited") ?></a></li>
</ul>
<h2><?php print _("Search functions") ?></h2>
<ul>
<li><a href="grep.php"><?php print _("The Old Search Form") ?></a></li>
<li><a href="search.php"><?php print _("The New Search Form") ?></a></li>
<li><a href="freetextsearch.php"><?php print _("Free text search") ?></a> <?php print _("for persons &amp; frozen") ?></li>
<li><a href="machine_search.php"><?php print _("Search for some kinds of machine information") ?></a></li>
</ul>
<h2><?php print _("Update functions") ?></h2>
<ul>
<li><a href="update.php"><?php print _("Single User Update") ?></a></li>
<li><?php print _("Show all") ?> <a href="duplicates.php"><?php print _("duplicate registrations") ?></a> <?php print _("at country level") ?>
</ul>
<h2><?php print _("Research functions") ?></h2>
<ul>
<li><a href="oldfrozen.php"><?php print _("Old frozen records (do research to find them)") ?></a></li>
</ul>
<h2><?php print _("Other functions") ?></h2>
<ul>
<li><a href="/cgi-bin/adm/adminlogin.cgi"><?php print _("Login to your counter entry") ?></a></li>
<li><a href="password.php"><?php print _("Change your admin password") ?></a></li>
</ul>
<h2><?php print _("My places") ?></h2>
<?php

function showmaintainedplaces($login)
{

  $query = mysql_query("select places.f_key, name, longname from places, link_place_maintainer, users where places.f_key = link_place_maintainer.fromkey and users.login = '$login' and link_place_maintainer.tokey = users.f_key");
  if ($query == 0) {
    print(_("MySQL error") . ": " . mysql_errno() . ":" . mysql_error() . "<br>");
    die("Query for maintained places failed");
  }
  print "<ul>\n";
  while ($arr = mysql_fetch_array($query)) {
    print "<li> <a href=\"/cgi-bin/adm/place.cgi?place=". $arr[0] . "\">";
    print $arr[1] . " - " . $arr[2] . "</a></li>\n";
  }
  print "</ul>\n";
}

showmaintainedplaces(getenv('REMOTE_USER'));

?>
<h2><?php print _("Documentation") ?></h2>
<a href="<?php print $counter_site ?>/~tabatha/"><?php print _("The Linux Counter Manager's HOWTO") ?></a> <?php print _("by") ?> Tabatha Marshall &lt;<?php echo emailCloaking("tabatha@merlinmonroe.com",0)?>&gt; <?php print _("is your source of information on how to do things in the counter. Give feedback!") ?>
<p>
<a href="<?php print $counter_site ?>/help/places.php"><?php print _("A brief note on places") ?></a>
<p>

<?php print _("Enjoy!") ?>
<p>
Harald T. Alvestrand &lt;<?php echo emailCloaking("Harald@Alvestrand.no",0)?>&gt;
<?php pagebottom("yes") ?>
</body>
</html>
